﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using MySql.Data.MySqlClient;

namespace DAL
{
    /// <summary>
    /// 订单增加时类别
    /// </summary>
    public class DictionaryTypeDAL
    {
        //获取门型编号另加装饰条
        public DataTable GetOtherName(string mxbhid)
        {
            return SqlHelper.ExecuteDataTable("select * from otherdecoration where mxbhid=@mxbhid and isdel=0 and decparentId=0", new MySqlParameter("@mxbhid", mxbhid));
           
        }

        //获取门型另加装饰条
        public DataTable GetOtherDetail(string xmbh, string pid) {
            return SqlHelper.ExecuteDataTable("select * from otherdecoration where isdel=@isdel and decparentid=@decparentid and mxbhid=@mxbhid", new MySqlParameter("@isdel", "0"), new MySqlParameter("@decparentid", pid), new MySqlParameter("mxbhid", xmbh));
        }

        //获取包装单独包数
        public DataTable GetPackageUnitPrice() {
            return SqlHelper.ExecuteDataTable("select * from package where isdel=@isdel and unittype=1", new MySqlParameter("@isdel", "0"));
        }
        //获取包装类型
        public DataTable GetPackageType()
        {
            return SqlHelper.ExecuteDataTable("select * from package where isdel=@isdel", new MySqlParameter("@isdel", "0"));
        }
        //门型列表
        public DataTable MxbhListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select * from mxbh where isdel=@isdel order by mxbh", new MySqlParameter("@isdel", "0"));
            return dt;
        }
        //拼接方式
        public DataTable PjfsListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select pid,pjfs,bzsm from menxingpjsf where isdel=@isdel", new MySqlParameter("@isdel", "0"));
            return dt;
        }
        //玻璃种类
        public DataTable SpecialGlassListAll() {
            DataTable dt = SqlHelper.ExecuteDataTable("select gid,glasstype,glassprice from specialglass where isdel = @isdel and isspecial=1 ", new MySqlParameter("@isdel", "0"));
            return dt;
        }
        //正常玻璃种类
        public DataTable NormalGlassListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select gid,glasstype,glassprice from specialglass where isdel = @isdel and isspecial=0 ", new MySqlParameter("@isdel", "0"));
            return dt;
        }
       
        //表面pvc颜色
        public DataTable MenxingColorListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select mid,mColor,mPrice,isold from menxingColor where isdel=@isdel and isold=0 and gylb=0", new MySqlParameter("@isdel", "0"));
            return dt;
        }
        //芯板做旧颜色
        public DataTable MenxingXbzjColorListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select mid,mColor,mPrice,isold from menxingColor where isdel=@isdel and isold=1 and gylb=0", new MySqlParameter("@isdel", "0"));
            return dt;
        }

        //装饰线条做旧价格
        public DataTable ZsxtzjColorListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select mid,mColor,mPrice,isold,gylb from menxingColor where isdel=@isdel and isold=1 and gylb=1", new MySqlParameter("@isdel", "0"));
            return dt;
        }

        //打孔方向
        public DataTable KkfxListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select kid,direction,bzsm from kkfx where isdel=@isdel", new MySqlParameter("@isdel", "0"));
            return dt;
        }
        //装饰线条
        public DataTable ZsxtListAll()
        {
            DataTable dt = SqlHelper.ExecuteDataTable("select zid,zsbh,zsmc,zsdj,zslb,xtcd,oldprice from zsxt where isdel=@isdel", new MySqlParameter("@isdel", "0"));
            return dt;
        }

        //所有颜色
        public DataTable ColorListAll() {
            DataTable dt = SqlHelper.ExecuteDataTable("select mid,mColor,mPrice,isold from menxingColor where isdel=@isdel and isold=1 ", new MySqlParameter("@isdel", "0"));
            return dt;
        }

    }
}
